package shared;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class ConfigLoader 
{
	private DocumentBuilder builder;
	private Document doc;
	
	// Constants
	
	
	public ConfigLoader()
	{
		
	}
	
	private void initDocument()
	{
		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		try 
		{
			builder = factory.newDocumentBuilder();
			doc = builder.newDocument();
		} 
		catch (ParserConfigurationException e) 
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	private void writeRoot()
	{
		Element root = doc.createElement("configuration");
		doc.appendChild(root);
	}
	
	private void writePort(int portNum)
	{
		Element port = doc.createElement("port");
		port.appendChild(doc.createTextNode(""+portNum));
		doc.appendChild(port);
	}
	
	
}
